//
//  KuKu_LinK.swift
//  kuku
//
//  Created by 清风徐来 on 2024/1/23.
//

import UIKit

@objc open class KuKu_LinK: NSObject {

    /// 打开指定链接
    /// - Parameter url: 要打开的 URL
    @objc public static func openLink(with url: URL) {
        if UIApplication.shared.canOpenURL(url) {
            if #available(iOS 10.0, *) {
                UIApplication.shared.open(url, options: [:]) { success in
                    if success {
                        print("Open url success")
                    }
                }
            } else {
                // 对于 iOS 10.0 以下版本
                UIApplication.shared.openURL(url)
            }
        } else {
            print("无法打开链接")
        }
    }

}
